- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.6k
          [py][bidi]: add high level API for script module - pin, unpin and execute
          #15936
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
  
    [py][bidi]: add high level API for script module - pin, unpin and execute
  
  #15936
              Conversation
| PR Reviewer Guide 🔍Here are some key observations to aid the review process: 
 | 
| PR Code Suggestions ✨No code suggestions found for the PR. | 
…y-bidi-script-high-level-API
…y-bidi-script-high-level-API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I think we might want to tweak execute so it can accept non-function scripts because at some point we'd like to replace driver.execute_script with driver.script.execute and the former one accepts plain scripts. Something like this:
driver.script.execute("return window.location;")This can be done later however, thank you for working on this!
| Thank you @p0deje for the review, I will try to implement your suggestion in the future. | 
User description
🔗 Related Issues
💥 What does this PR do?
Adds 3 high level SCRIPT APIs as mentioned in #13992
pinunpinexecute🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add high-level BiDi script API methods:
pin,unpin,executeImplement argument conversion for BiDi LocalValue format
Add comprehensive test coverage for script execution scenarios
Enable script pinning/unpinning and execution with error handling
Changes walkthrough 📝
script.py
Implement high-level BiDi script API methodspy/selenium/webdriver/common/bidi/script.py
pin(),unpin(),execute()webdriver.py
Update Script initialization with driver referencepy/selenium/webdriver/remote/webdriver.py
bidi_script_tests.py
Add comprehensive tests for high-level script APIpy/test/selenium/webdriver/common/bidi_script_tests.py